/**
 * 
 */
package sailing.ui.base;

import java.awt.BorderLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;

import sailing.listener.UI;
import sailing.ui.laf.TitlePanelUI;

/**
 * @author kevin
 * 
 */
public class TopTitlePanel extends JPanel {
	private String title;

	private JLabel titleLabel;
	private Border marginBorder = BorderFactory.createEmptyBorder(3, 0, 0, 0);

	public TopTitlePanel(String title) {
		super();
		this.title = title;
		this.initial();
	}

	private void initial() {
		JPanel panel = new JPanel();
		//panel.setBorder(BorderFactory.createEtchedBorder());
		//panel.setBackground(titleBgColor);
		panel.setOpaque(false);
		titleLabel = new JLabel(this.title);
		titleLabel.setFont(UI.font14);
		panel.add(titleLabel);
		
		this.setLayout(new BorderLayout());
		this.setBorder(marginBorder);
		this.add(panel, BorderLayout.CENTER);
		this.setBorder(BorderFactory.createEmptyBorder(1, 4, 1, 4));
		this.setUI(new TitlePanelUI());
	}
}
